package com.cssw.fyzb.job.executor.config;

import com.cssw.fyzb.core.es.EsClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Feng Chen
 */
@Configuration
public class EsConfig {

    @Value("${es.cluster}")
    private String cluster;

    @Value("${es.addrs}")
    private String addrs;

    @Bean(destroyMethod = "close")
    public EsClient esClient() {
        return new EsClient(cluster, addrs);
    }

}
